<?php

namespace App\Http\Controllers\Home;

use Illuminate\Http\Request;
use DB;
use App\Http\Requests;
use App\Http\Controllers\Controller;

class BbsController extends Controller
{
    //
    public function getIndex()
    {	
    	//获取session id
    	$id=session('userid');
    	//穿用户名到论坛
    	$user = DB::table('userdetail')->where('id',$id)->first();
    	//遍历帖子模块
    	$res = DB::table('posttype') -> get();
    	//头部导航
    	$ress = DB::table('portaltype')->where('pid',0)->get();
    	 //dd($ress);
    	//bbs轮播图
    	$resss = DB::table('fcon')
    				
    				->where('position',3)
    				->get();
    	//dd($resss);
    	return view('Home.bbs.index',['type' => $res,'ress'=>$ress,'resss'=>$resss,'user'=>$user]);
    }
}
